package app;

import org.hibernate.Transaction;

import entities.*;
import entityDAOs.*;


public class AddEntityInstances {

	public AddEntityInstances(){}
	

	public static void addObject(Object p) {
		Object dao = null;
		Transaction tx = null;
					
		if(p.getClass().getCanonicalName() == "entities.Departament")
		{			
			dao = new DepartamentDAO();
			tx = ((DepartamentDAO)dao).getSession().beginTransaction();
			((DepartamentDAO)dao).save((Departament)p);
		}
		
		tx.commit();
		
	}
	
	
	
		
}
